<%@page import="com.wef.demo.entity.domain.StudentSubjectDomain"%>
<%@page import="com.wef.demo.entity.domain.StudentDomain"%>
<%@page import="com.wef.demo.entity.domain.ClazzDomain"%>
<%@page import="com.wef.demo.entity.domain.SubjectDomain"%>
<%@page import="com.gfa4j.resource.ResourceManagerServer"%>
<%@page import="com.wef.common.util.CommonMessageDomain"%>
<%@page import="com.gfa4j.query.Field"%>
<%@ include file="/pages/common/taglib.jsp"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
	<k:jqgrid 
		queryObjectName="<%=StudentDomain.Student%>"
	 	jsonReader="{id:'studentId'}"
	 	colModel="[{name:'studentId',hidden:true},
	 		{label:'demo.Student.studentNum',name:'studentNum'},
	 		{label:'demo.Student.studentName',name:'studentName'},
	 		{label:'demo.Student.birthday',name:'birthday',formatter:'date',formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d'},originalDataType:'date'},
	 		{label:'demo.Student.address',name:'address'},
	 		{label:'demo.Student.telphone',name:'telphone'},
	 		{label:'demo.Student.phone',name:'phone'},
	 		{label:'demo.Student.gender',name:'gender',formatterValueText:[{value:true,text:'男'},{value:false,text:'女'}]},
	 		{label:'demo.Student.email',name:'email'},
	 		{label:'demo.Student.idCard',name:'idCard'},
	 		{label:'demo.Student.remark',name:'remark'}]"		 		
		id="tableStudent"
	 	newBtnId="newBtnStudent"
	 	saveBtnId="saveBtnStudent"
	 	cancelBtnId="cancelBtnStudent"
	 	deleteBtnId="deleteBtnStudent"
	 	editFormId="editFormStudent"
	 	serviceMethodName="saveOrUpdateStudents"
	 	serviceName="StudentService"
	 	setQueryInfo="setQueryInfo4Student"
	 	enabledLoad="false"
	 	afterSelectRow="afterSelectRow4Student"
	 	autowidth="false"
	 	beforeSave="beforeSave4Student"		 	
	 	/>
 	
 		<script type="text/javascript">
			$(window).ready(function(){
// 				alert("item1");
// 				$('div[accordion=true]').accordion({collapsible : true});
// 				$('div[tabGroup=true]').tabs();
// 				$('#tabgroup2').tabs("url",1,App.ctx+"/pages/demo/multi-table/demo_tab_load_edit_item2.jsp").tabs({ cache: true });

				//打开弹出层
				$("#dialog_demo_tab_load2_edit_item1").dialog($.extend({},$.ui.dialogDefaultConfig,{
					modal:true,
					resizable:true,
					minHeight:350,
					minWidth:600,
					width:600,
					height:360,
					autoOpen:false,
					buttons:[{
						"text":i18n.global.close,
						"click":function(){
							$(this).dialog("close");
						}
					}]
				})).bind("dialogopen",function(){
					$('#tableStudent').jqGrid("reloadGrid");
					//弹出层中有grid需调用重置宽度(弹出层上的grid 要小于弹出层(width)50的宽度)
					$('#tableStudent').jqGrid("resetGridWidth",true,550);
				}).dialog("open");
			});
		</script>
 	
<!--  	<div id="tabItem2"> -->
			<div id=dialog_demo_tab_load2_edit_item1 title="<%=ResourceManagerServer.getInstance().getMessage(CommonMessageDomain.TITLE_EDIT)%>" style="display: none;">

				<div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active">
					<ul class="button_box">
						<li>
							<k:button styleId="newBtnStudent" styleClass="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" text="<%=CommonMessageDomain.BUTTON_NEW%>"/>
						</li>
						<li>
							<k:button styleId="saveBtnStudent" styleClass="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" text="<%=CommonMessageDomain.BUTTON_SAVE%>"/>
						</li>
						<li>
							<k:button styleId="cancelBtnStudent" styleClass="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" text="<%=CommonMessageDomain.BUTTON_CANCEL%>"/>
						</li>
						<li>
							<k:button styleId="deleteBtnStudent" styleClass="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" text="<%=CommonMessageDomain.BUTTON_DELETE%>"/>
						</li>
					</ul>
				</div>
				
				<div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active">
					<div>
						<table id="tableStudent"></table>
					</div>
				</div>
				
				<div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active">
					<form id="editFormStudent" name="editFormStudent">
						<ul id="editUlStudent" allowChange="true" class="edit_box">
							<k:hidden property="studentId" styleId="editStudentId"/>
							<k:hidden property="recordVersion" styleId="editRecordVersion"/>
							<li>
								<k:label text="demo.Student.studentNum" allowBlank="false"/>
								<k:text property="studentNum" styleId="editStudentNum" styleClass="text"/>
							</li>
							<li>
								<k:label text="demo.Student.studentName" allowBlank="false"/>
								<k:text property="studentName" styleId="editStudentName" styleClass="text"/>
							</li>
							<li>
								<k:label text="demo.Student.birthday" allowBlank="false"/>
								<k:date property="birthday" styleId="editBirthday" styleClass="text"/>
							</li>
							<li>
								<k:label text="demo.Student.address" allowBlank="false"/>
								<k:text property="address" styleId="editAddress" styleClass="text"/>
							</li>
							<li>
								<k:label text="demo.Student.telphone" allowBlank="false"/>
								<k:text property="telphone" styleId="editTelphone" styleClass="text"/>
							</li>
							<li>
								<k:label text="demo.Student.gender" allowBlank="false"/>
								<k:radio property="gender" text="男" value="true" />
								<k:radio property="gender" text="女" value="false" />
							</li>
							<li>
								<k:label text="demo.Student.email" allowBlank="false"/>
								<k:text property="email" styleId="editEmail" styleClass="text"/>
							</li>
							<li>
								<k:label text="demo.Student.idCard" allowBlank="false"/>
								<k:text property="idCard" styleId="editIdCard" styleClass="text"/>
							</li>
							<li>
								<k:label text="demo.Student.email" allowBlank="false"/>
								<k:text property="email" styleId="editEmail" styleClass="text"/>
							</li>
							<li>
								<k:label text="demo.Student.remark" allowBlank="false"/>
								<k:textarea property="remark" styleId="editRemark"/>
							</li>
						</ul>
					</form>
				</div>
			</div>
<!-- 	</div> -->